<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title>今日生机论坛--后台管理页面</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="icon" href="../favicon.ico">
		<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
		<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js"></script>
		<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
		<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/bootStrap4.6.1.css">
		<script src="jquery-3.4.1.min.js"></script>
		<script src="/js/bootstrap-bunlde.js"></script>

	</head>
	<body>
		<div class="container-fluid">
			<div class="row border border-bottom shadow navbar">
				<div class="col-2"><a href=""><img src="/img/logo/logo.png" class="w-100"></a></div>
				<div class="col-9"></div>
				<div class="col-1">
					<div class="dropdown">
						<button type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" th:text="${session.user.userName}">

							<!--<div th:text="${session.user.userName}"></div>-->

							<!--蒋劲豪-->
							<span class="caret"></span>
						</button>
						<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
							<li role="presentation">
								<a role="menuitem" tabindex="-1" href="#">注销</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="row mt-5">
				<div class="col-2 border rounded shadow">
					<ul class="nav nav-pills">
						<li class="active w-100"><a href="#" class="btn btn-default w-100" onclick="showPost()">审核中的帖子</a></li>
						<li class="active w-100"><a href="#" class="btn btn-default w-100" onclick="showUser()">用户管理</a></li>
					</ul>
				</div>
				<div class="col-1"></div>
				<div class="col-8 border rounded shadow">
					<!-- 审核中的帖子 -->
					<div class="post">
						<table class="table table-striped">
							<caption>审核中的帖子</caption>
							<thead>
								<tr>
									<th>用户</th>
									<th>标题</th>
									<th>操作</th>
								</tr>

							</thead>
							<tbody>
								<tr th:each="list,listIter:${list}">
									<td th:text="${list.userId}"></td>
									<td th:text="${list.articleTitle}"></td>
									<td><a th:href="@{/article/toExamine(articleId=${list.articleId},status=1)}">通过</a>&emsp;<a th:href="@{/article/toExamine(articleId=${list.articleId},status=2)}">退回</a></td>
								</tr>
								<!--<tr>
									<td>1</td>
									<td>tim</td>
									<td>撞到脚趾肿么办？</td>
									<td><a href="">通过</a>&emsp;<a href="">退回</a></td>
								</tr>
								<tr>
									<td>2</td>
									<td>jack</td>
									<td>今天又空军了！</td>
									<td><a href="">通过</a>&emsp;<a href="">退回</a></td>
								</tr>
								<tr>
									<td>3</td>
									<td>tom</td>
									<td>误吞了西瓜子还有救吗？</td>
									<td><a href="">通过</a>&emsp;<a href="">退回</a></td>
								</tr>-->
							</tbody>
						</table>
					</div>
					<!-- 用户管理 -->
					<div class="user" style="display: none;">
						<table class="table table-striped">
							<caption>用户管理</caption>
							<thead>
								<tr>
									<th>id</th>
									<th>用户名</th>
									<th>性别</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<tr th:each="userList,userListIter:${userList}">
									<td th:text="${userList.userId}"></td>
									<td th:text="${userList.userName}"></td>
									<td th:text="${userList.userSex}"></td>
									<!--<td th:switch="${userList.id}">
										<p th:case="1001">名字</p>
										<p th:case="1002">年龄</p>
										<p th:case="*">其他</p>
									</td>-->
									<td th:switch="${userList.userState}">
										<p th:case="0"><a th:href="@{/user/modifyState(userId=${userList.userId},userState=1)}">启用</a></p>
										<p th:case="1"><a th:href="@{/user/modifyState(userId=${userList.userId},userState=0)}">禁用</a></p>
									</td>
									<!--<td><a href="">修改</a>&emsp;<a th:href="@{/article/toExamine(articleId=${list.articleId},status=2)}">禁用</a></td>-->
								</tr>
							</tbody>
						</table>
					</div>

				</div>
				<div class="col-1"></div>
			</div>
		</div>

		<script>
			$(function(){});
			function showPost(){
				$(".post").show();
				$(".post").siblings().hide();
			}
			function showUser(){
				$(".user").show();
				$(".user").siblings().hide();
			}
		</script>
	</body>
</html>
